Re: [racket-users] How to find most efficient constructs/instructions beside benchmarking?

2015-04-12 Thread George Neuner

On 4/12/2015 10:22 AM, Lux wrote:

For future reference for who will read this topic:

This announcement on sqlite mailinglist seems to at least partially prove my point for 
usefulness of "micro-optimization", something valuable to research from my 
point of view.

"""50% faster than 3.7.17"""

"""
This is 50%
faster at the low-level grunt work of moving bits on and off disk and
search b-trees.  We have achieved this by incorporating hundreds of
micro-optimizations.  Each micro-optimization might improve the performance
by as little as 0.05%.  If we get one that improves performance by 0.25%,
that is considered a huge win.  Each of these optimizations is unmeasurable
on a real-world system (we have to use cachegrind to get repeatable
run-times) but if you do enough of them, they add up."""

Read the rest on:

http://permalink.gmane.org/gmane.comp.db.sqlite.general/90549


Somebody doesn't understand fractions: the numbers show a 33% 
improvement, not 50%.  3.7 is 50% slower, but 3.8 is only 33% faster.


And the conclusion about improved code efficiency is ... not wrong per 
se, but not exactly correct either ... because cachegrind doesn't 
measure code efficiency, but rather it profiles memory accesses.  A lot 
of that speed improvement can be explained simply by elimination of 
redundant data movement.  SQL operations generally are hostile to CPU 
cache optimizations, so the objective always is to reduce overall data 
movement within the system.  Clever implementations of set and bag 
operations which avoid unnecessary copying is what separates commercial 
quality RDBMS from toys.


Note that 3.7 added major new features which slowed it wrt previous 
versions and many of the optimizations in 3.8 were to fix performance 
issues in the 3.7 functionality.  Note also that they spent 16 months 
doing it and that 3.8 consequently has introduced only 1 significant new 
feature.



I mentioned previously that I have done HRT programming, so I understand 
the urge to make code as efficient as possible.  But you can spend 
months or years tweaking a program, only to find that the next 
generation CPU (or DDR4 memory system or SSD storage or ... ) makes a 
lot of your hard work superfluous.


Most programs simply can't justify the developer time to micro optimize 
them.  Most of the time micro optimization a waste of developer effort 
that would be better spent devising better algorithms and data 
structures - it only makes a difference where you can't squeeze anything 
more out of you algorithm ... a situation which is quite rare.  There 
are some obvious cases, but most programmer guesses at where high 
optimization is needed are simply wrong - you really have to profile 
execution using representative data.  In those cases where tweaking is 
warranted: e.g., programs with humongous data sets or requiring real 
time results, etc., the optimizations typically can be confined to less 
than 2% of the code (the other 98% of the program will not measurably 
benefit).   In contrast, all code benefits from more efficient 
algorithms and data structures.


George

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] pict3d

2015-04-12 Thread 'John Clements' via users-redirect
1) pict3d is Totally magnificent. Think I said this before.
2) New OS X mouse controls are excellent.
3) Doc bug (I think). You write

"Shapes: visible 2D surfaces in 3D space. Surfaces are visible on only one 
side.”

I believe the first word and the first word of the second sentence should be 
the same, e.g.:

Shapes: visible 2D surfaces in 3D space. Shapes are visible on only one side.

or

Surfaces: visible 2D surfaces in 3D space. Surfaces are visible on only one 
side.

John

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] DrRacket plugin to remove trailing whitespace on save?

2015-04-12 Thread Jon Zeppieri
If you mean: "don't remove entire lines that consist of only
whitespace," then I agree.
If you mean: "don't remove any trailing whitespace from lines that
consist only of whitespace," then I do not.

-Jon


On Sun, Apr 12, 2015 at 7:01 PM, Alexis King  wrote:
> If you decide to do this, please make it so it doesn’t trim whitespace from
> whitespace-only lines. For some reason a lot of IDEs do this, and it’s a pet
> peeve of mine.
>
> On Apr 12, 2015, at 15:14, Robby Findler 
> wrote:
>
> No but Max changed the way return works so there should be less whitespace
> added going forward.
>
> Writing a script to trim whitespace from line-endings would work well if it
> were to use text% IMO. Use load-file to get a file and then the paragraph
> methods to find line endings and then delete stuff and ace the file again.
>
> Robby
>
> On Sunday, April 12, 2015, Jon Zeppieri  wrote:
>>
>> Does such a think already exist?
>>
>> -Jon
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to racket-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] DrRacket plugin to remove trailing whitespace on save?

2015-04-12 Thread Robby Findler
No but Max changed the way return works so there should be less whitespace
added going forward.

Writing a script to trim whitespace from line-endings would work well if it
were to use text% IMO. Use load-file to get a file and then the paragraph
methods to find line endings and then delete stuff and ace the file again.

Robby

On Sunday, April 12, 2015, Jon Zeppieri  wrote:

> Does such a think already exist?
>
> -Jon
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] DrRacket plugin to remove trailing whitespace on save?

2015-04-12 Thread Jon Zeppieri
Does such a think already exist?

-Jon

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] How to find most efficient constructs/instructions beside benchmarking?

2015-04-12 Thread Lux
For future reference for who will read this topic:

This announcement on sqlite mailinglist seems to at least partially prove my 
point for usefulness of "micro-optimization", something valuable to research 
from my point of view.

"""50% faster than 3.7.17"""

"""
This is 50%
faster at the low-level grunt work of moving bits on and off disk and
search b-trees.  We have achieved this by incorporating hundreds of
micro-optimizations.  Each micro-optimization might improve the performance
by as little as 0.05%.  If we get one that improves performance by 0.25%,
that is considered a huge win.  Each of these optimizations is unmeasurable
on a real-world system (we have to use cachegrind to get repeatable
run-times) but if you do enough of them, they add up."""

Read the rest on:

http://permalink.gmane.org/gmane.comp.db.sqlite.general/90549

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] modifying readtable entry for `(` breaks reading #hash() ?

2015-04-12 Thread Alexander D. Knauth
For something like this:
#lang racket
(define orig-readtable (current-readtable))
(parameterize ([current-readtable
(make-readtable orig-readtable
#\( 'terminating-macro
(λ (c in src ln col pos)
  (read-syntax/recursive src in c 
orig-readtable)))])
  (println (read (open-input-string "()"))) ; ’()
  (println (read (open-input-string "#hash()"  ; . read: bad syntax `#hash('

I can understand why this could be a problem, but why doesn't it work so that 
if reading the () produces the correct association list, it still works?

Otherwise is there any way around it without just reimplementing #hash(), 
#hasheq(), #hasheqv(), #(), etc. ?  

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.