question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to improve the performance of line()?

See original GitHub issue

I started with examples/timeseries.ipynb, modifying to have only one column:

screen shot 2017-09-08 at 11 31 52 pm

In a bit of an ugly process, I then time canvas.line() and canvas.points() for increasing repeats of the dataframe:

screen shot 2017-09-08 at 11 33 20 pm

line seems to be a lot slower than points:

screen shot 2017-09-08 at 11 46 38 pm screen shot 2017-09-08 at 11 47 37 pm

(Sorry for the screenshots, but github doesn’t seem to allow notebooks to be attached.)

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jbcrailcommented, Sep 11, 2017

My immediate suggestions for performance gains are:

  1. Switch to integer-specific Bresenham line-drawing algorithm

We currently use the more general algorithm that supports both ints and floats. However, by the time we need to draw a line, the points have been mapped to an integer space so float support is redundant.

  1. Switch line-clipping algorithm

We currently use Cohen-Sutherland for clipping a line to a bounding box, but the Liang-Barsky algorithm is considered significantly more efficient.

0reactions
jbednarcommented, Oct 18, 2017

It would be nice to re-run those benchmarks now that #495 has been merged.

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 Ways to Boost Your Line's Performance -- Right Now
5 Ways to Boost Your Line's Performance -- Right Now · 1. Reward trainers.First, model the behaviour you want. · 2. Reward small...
Read more >
Increase Performance With Fewer Lines of Code
Data science is intimately associated with performance, whether it is ... That is a massive improvement with just a short line of code....
Read more >
If we reduce the lines of code, will it run faster? - Quora
TL;DR both alternatives may be true. Many times, less readable and longer code hides speed issues, by shortening and cleaning it up one...
Read more >
Improving C++'s reading file line by line? - Stack Overflow
How can you avoid it? Use other libraries for high performance async I/O like boost asio or native functions that are provided by...
Read more >
Performance Tuning SQL Queries | Advanced SQL - Mode
But if you were talking about hundreds of thousands of rows or more, you'd see a noticeable improvement by aggregating before joining. When...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found